<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<p:dialog xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui" 
	modal="true" width="800" height="300" resizable="false" 
	widgetVar="dialogListPais" id="listDialogPais"
	appendToBody="true">
	
	<ui:define name="title">Consultar País
	</ui:define>

	<f:facet name="header">
			<h:outputText value="Consultar País"/>
	</f:facet>
	
	<h:form id="formListPais">
		<div style="margin-left:5%;">
			<h:panelGrid columns="1" style="float:left;width: 660px;height:40px;">
				<h:outputText value="Código:"/>
				<h:inputText style="width:100px;"/>
			</h:panelGrid>
		
			<h:panelGrid columns="1" style="float:left;width: 660px;height:40px;">
				<h:outputText value="País"/>
				<h:inputText style="width:250px;"/>
			</h:panelGrid>
		
			<div style="float:left;width:96%; padding-bottom:10px;text-align:right;">
				<p:commandButton value="Consultar" style="height:28px;"/>
				<p:commandButton value="Novo" style="height:28px;" onclick="dialogAddPais.show();"/>
				<p:commandButton value="Limpar" style="height:28px;"/>
			</div>
		
			<div style="float:left;">
				<p:dataTable id="dialogListPais" value="#{paisBean.paises}"
					var="pais" selectionMode="single" style="width:705px" 					
					 selection="#{estadoBean.selectedPais}" rowKey="#{pais.id}"> 					
			        <p:column headerText="Código" style="width:100px;">  
			            <h:outputText value="#{pais.id}" />  
			        </p:column>			  
			        <p:column headerText="País">  
			            <h:outputText value="#{pais.pais}" />  
			        </p:column>  	
		  	  </p:dataTable>
			</div>
			
			<div>
				<p:commandButton value="Adicionar" actionListener="#{estadoBean.addPais}"
				process="@this formListPais" update="formListPais" style="margin-right: 5px;"/>
				
				<p:commandButton
					actionListener="#{estadoBean.closeDialogListPais}"
					value="Cancelar" process="@none" />
			</div>
		</div>
		
		
		
		<ui:include src="formPais.xhtml"></ui:include>
	</h:form>
</p:dialog>